restore floating point registers from stack in reverse order#37
Conversation
This commit applies the patch from steipete/InterposeKit#37, which resolves an issue affecting swizzled methods that take `CGFloat` parameters or structs containing `CGFloat` (such as `CGPoint` or `CGRect`) on ARM64. The issue occurred because floating-point registers were apparently not being restored in the correct order, causing values in those registers to become shuffled after the trampoline call. The fix ensures that floating-point registers are restored in reverse order, as required by ARM64 calling conventions. According to the referenced PR, regular registers were already handled correctly, so this issue specifically affected floating-point parameters.
bcec4a0 to
a19eff5
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep this PR open: current Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes, at source level: an arm64 object hook calling an original method with eight distinct floating-point arguments exercises all saved Is this the best way to solve the issue? Yes. Reordering the four loads is the narrow inverse of the existing pre-index stores, and the position-sensitive eight-argument test directly guards the reported failure without adding another behavior path. Security review: Security review cleared: The diff introduces no dependency, workflow, secret, permission, downloaded-code, or package-resolution changes. AGENTS.md: not found in the target repository. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against a29733d40a88. |
We should restore registers preserved in stack in reverse order. Otherwise, it leads to shuffled values in those registers after trampoline.
The simplest way to reproduce is to swizzle any method from UIKit that accepts CGFloat or plain struct like CGRect. It's relevant only to arm64.
Btw, regular registers get restored correctly.